#ifndef __AES__25DB80B9_EBEB_4297_AD44_E7EBE8591A55_H
#define __AES__25DB80B9_EBEB_4297_AD44_E7EBE8591A55_H

#include <stddef.h>

#define AES_BLOCK_SIZE  16
#define AES_ENCRYPT     1
#define AES_DECRYPT     0
#define AES_MAXNR       14

struct aes_key_st {
    unsigned int rd_key[4 * (AES_MAXNR + 1)];
    int rounds;
};
typedef struct aes_key_st AES_KEY;

int AesSetEncryptKey(const unsigned char* userKey, const int bits, AES_KEY* key);

int AesSetDecryptKey(const unsigned char* userKey, const int bits, AES_KEY* key);

void AesEncrypt(const unsigned char* in, unsigned char* out, const AES_KEY* key);

void AesDecrypt(const unsigned char* in, unsigned char* out, const AES_KEY* key);

void AesEcbEncrypt(const unsigned char* in, unsigned char* out, const AES_KEY* key, const int enc);

void AesCbcEncrypt(
    const unsigned char* in,
    unsigned char* out,
    size_t length,
    const AES_KEY* key,
    unsigned char* ivec,
    const int enc
);

void AesCfb128Encrypt(
    const unsigned char* in,
    unsigned char* out,
    size_t length,
    const AES_KEY* key,
    unsigned char* ivec,
    int* num,
    const int enc
);

void AesOfb128Encrypt(
    const unsigned char* in,
    unsigned char* out,
    size_t length,
    const AES_KEY* key,
    unsigned char* ivec,
    int* num
);

#endif
